<!DOCTYPE html>
<html lang="<?=$CONTEXT['lang']?>" <? if (sizeof($m = $HEAD['ns'])) foreach($m as $name => $content) { ?> <?=$name?>="<?=h($content)?>"<? } ?>>
<head><?
	?><meta charset="utf-8" /><?
	
	?><title><?=($t = xmeta('page-title')) ? $t : implode(' :: ', array_reverse(dat('title')))?></title><?

	if ($t = xmeta('page-description')) { ?><meta name="description" content="<?=h($t)?>"><? }

	if ($t = xmeta('page-keywords')) { ?><meta name="keywords" content="<?=h($t)?>"><? }

	if (sizeof($m = $HEAD['meta']))
		foreach($m as $name => $content) { 
			?><meta name="<?=h($name)?>" content="<?=h($content)?>"><? 
		}

/*
?><link rel="stylesheet" href="<?=autoVer('/style/sitewide.css')?>" /><?
?><link media="print" rel="stylesheet" href="/style/print.css" /><?
if (($l = context('lang')) && is_file($_SERVER['DOCUMENT_ROOT']."/style/langwide-$l.css")) { ?><link rel="stylesheet" href="/style/langwide-<?=$l?>.css" /><? }
if ($temp = meta('style')) { foreach($temp as $s) { ?><link rel="stylesheet" href="/style/<?=trim($s)?>.css" /><? } }
*/
?>

<?=Css()?>

<!--[if lt IE 9]>
	<link media="all" rel="stylesheet" href="/style/print-ie.css" />
<![endif]-->

<!--[if lt IE 7]>
<style media="screen">
body { behavior: url(/lib/csshover3.htc) } 
/* img { behavior: url(/lib/pngbehavior.htc) } */
</style>
<![endif]-->

<script></script>

<![if gt IE 8]>
<script src="/lib/head.min.js"></script>
<![endif]>

<? addScriptLink('jquery, jquery.tools, jquery.sbx');

if ($b = bits('html-head-include', 'user')) foreach($b as $bit) { include bit($bit); } 

?><link rel="shortcut icon" href="<?=autoVer('/favicon.ico')?>" type="image/x-icon">

</head>

<body<?=($m = meta('body_id')) ? " id=\"page-$m\"" : ''?><? 
	if ($b = bits('html-body-onload', 'user')) { 
		ob_start(); foreach($b as $bit) { include bit($bit); } if ($t = ob_get_clean()) { ?> onLoad="<?=$t?>"<? } 
	} ?>>
	<? if ($b = bits('html-body-start', 'user')) { foreach($b as $bit) { include bit($bit); } } ?>

	
<div id="wrapper"><div id="container">

<header>
	<h1 class="logo"><?
		if ($DATA['page']['tag'] & PT_MAIN) {
			?><?=config('site-name')?><?
		} else {
			?><a href="/" title="<?=config('site-name')?>"><?=config('site-name')?></a><?
		}
	?></h1>
</header>

<section class="main">

	<h2 class="page"><?=dat('page', 'localname')?></h2>

	<nav class="nav-main"><ul><?
		include bit('basic/main-menu/user', 'html', array('levels' => 1));
	?></ul></nav>